package com.xxl.controller;

import com.xxl.dto.vo.BlogCommentVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;

import java.io.IOException;

/**
 * @author xxl
 * @date 2023/4/5
 */

@Tag(name = "BlogCommentApi",description = "博客评论api")
public interface BlogCommentApi<T> {
    /**
     * 点赞
     *
     * @param uuid
     * @return  T
     */
    @Operation(summary = "点赞")
    @ApiResponse(responseCode = "200",description = "点赞成功")
    @ApiResponse(responseCode = "500",description = "点赞失败")
    @Parameter(name = "uuid",description = "博客id")
    T likeBlog(String uuid);
    /**
     * 取消点赞
     * @param uuid
     * @return
     */
    @Operation(summary = "取消点赞")
    @ApiResponse(responseCode = "200",description = "取消点赞成功")
    @ApiResponse(responseCode = "500",description = "取消点赞失败")
    @Parameter(name = "uuid",description = "博客id")
    T cancelLikeBlog(String uuid) throws IOException;

    /**
     * 评论
     * @param commentVo
     * @return T
     */
    @Operation(summary = "评论")
    @ApiResponse(responseCode = "200",description = "评论成功")
    @ApiResponse(responseCode = "500",description = "评论失败")
    @Parameter(name = "commentVo",description = "java评论实体类对象")
    T comment(@Validated  BlogCommentVo commentVo);

    /**
     * 用户删除自己发布的评论
     * @param commentID
     * @param uuid
     * @return T
     */
    @Operation(summary = "用户删除自己发布的评论")
    @ApiResponse(responseCode = "200",description = "删除评论成功")
    @ApiResponse(responseCode = "500",description = "删除评论失败")
    @Parameter(name = "commentID",description = "评论id")
    @Parameter(name = "uuid",description = "博客id")
    T deleteComment(String commentID,String uuid);
    /**
     * 博客主人删除自己博客的评论
     * @param commentID
     * @param uuid
     * @return T
     */
    @Operation(summary = "博客主人删除自己博客的评论")
    @ApiResponse(responseCode = "200",description = "删除评论成功")
    @ApiResponse(responseCode = "500",description = "删除评论失败")
    @Parameter(name = "commentID",description = "评论id")
    @Parameter(name = "uuid",description = "博客id")
    T deleteSelfBlogComment(String commentID,String uuid);
    /**
     * 讨厌（踩一脚）
     * @param uuid
     * @return T
     */
    @Operation(summary = "讨厌（踩一脚）")
    @ApiResponse(responseCode = "200",description = "成功")
    @ApiResponse(responseCode = "500",description = "失败")
    @Parameter(name = "uuid",description = "博客id")
    T noLikeBlog(String uuid);
    /**
     * 不讨厌
     * @param uuid
     * @return T
     */
    @Operation(summary = "不讨厌）")
    @ApiResponse(responseCode = "200",description = "成功")
    @ApiResponse(responseCode = "500",description = "失败")
    @Parameter(name = "uuid",description = "博客id")
    T cancelNoLikeBlog(String uuid);

}
